package android.medicalcloud.com.yiapp.yilian.ui.fragment;

import android.medicalcloud.com.yiapp.yilian.ui.view.adapter.CalderAdapter;

import com.roomorama.caldroid.CaldroidFragment;
import com.roomorama.caldroid.CaldroidGridAdapter;

import java.util.ArrayList;


/**
 * riqi fragment
 */
public class CalderFragment extends CaldroidFragment {

    @Override
    public CaldroidGridAdapter getNewDatesGridAdapter(int month, int year) {
        return new CalderAdapter(getActivity(), month, year,
                getCaldroidData(), extraData);
    }


    public CaldroidGridAdapter getCurrentAdapter(int year,int month){

        ArrayList<CaldroidGridAdapter> list = getDatePagerAdapters();
        if (list!=null){
            for (CaldroidGridAdapter adapter:list){

                if (adapter.getYear()==year&&adapter.getMonth()==month){
                    return adapter;

                }

            }
        }
        return null;
    }
}
